﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DDBS_test
{
    public class Sample
    {
        public string Name { get; set; }
        public string Author { get; set; }
        public string Company { get; set; }
        public string Shard { get; set; }
        public string OriginShard { get; set; }
        public List<Peak> Peeks { get; set; }

        public Sample()
        { }

        public Sample(string Name)
        {
            this.Name = Name;
        }

        public Sample(string Name, List<Peak> Peeks)
        {
            this.Name = Name;
            this.Peeks = Peeks;
        }

        public Sample(string Name, string Shard, List<Peak> Peeks)
        {
            this.Name = Name;
            this.Shard = Shard;
            this.Peeks = Peeks;
        }

        public override string ToString()
        {
            string peaksString = String.Join("; ", Peeks);
            return String.Format("Name: {0}, Shard: {1} => {2}", Name, Shard, peaksString);
        }

        // for graph
        public double[] getMs()
        {
            return Peeks.Select(p => p.M).ToArray();
        }

        // for graph
        public decimal[] getVs()
        {
            return Peeks.Select(p => p.V).ToArray();
        }
    }
}
